#include"stdafx.h"

bool MoveToCenter(const HWND& hWnd, const int& sizeX, const int& sizeY, const int& offsetX = 0, const int& offsetY = 0)
{
	int ScreenX, ScreenY;
	if (!MoveWindow(hWnd, 0, 0, sizeX, sizeY, FALSE))
	{
		return false;
	}
	ScreenX = GetSystemMetrics(SM_CXSCREEN);
	ScreenY = GetSystemMetrics(SM_CYSCREEN);
	if (!MoveWindow(hWnd, (ScreenX - sizeX) / 2 + offsetX, (ScreenY - sizeY) / 2 - 50 + offsetY, sizeX, sizeY, FALSE))
	{
		return false;
	}
}